# Contributor: Bart Ribbers <bribbers@disroot.org>
# Maintainer: Bart Ribbers <bribbers@disroot.org>
pkgname=hfd-service
pkgver=0.1.0
pkgrel=1
pkgdesc="Service that manages human feedback devices on mobile devices"
url="https://gitlab.com/ubports/core/hfd-service"
arch="all"
license="LGPL-3.0-only"
makedepends="
	cmake-extras
	eudev-dev
	qt5-qtbase-dev
	qt5-qtfeedback-dev
	"
subpackages="$pkgname-openrc"
source="https://gitlab.com/ubports/core/hfd-service/-/archive/$pkgver/hfd-service-$pkgver.tar.gz
	hfd-service.initd
	"
options="!check" # No tests

build() {
	cmake -B build \
		-DCMAKE_BUILD_TYPE=None \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DENABLE_LIBHYBRIS=OFF
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build

	install -Dm755 "$srcdir"/hfd-service.initd "$pkgdir"/etc/init.d/hfd-service
	
	mkdir -p "$pkgdir"/usr/share/dbus-1/system.d/
	mv "$pkgdir"/etc/dbus-1/system.d/* "$pkgdir"/usr/share/dbus-1/system.d/
}

sha512sums="26d2e6035e1de1f33450456ac2bcca934c0d2ae8211566589dede9ba680cf291f15083c45ce1742f23d6bcd30b8f2b0efa65ec10f6d70191762f8647b8347c38  hfd-service-0.1.0.tar.gz
f91b1f2ef4c1a485a5e0f0e71a83592d6cb7c27aee706a02dcdbb2a71d3ecfb366ffdb2727cdbf31be040c6ad4b02041c72d4cf77675a29e0fc2730572bd8017  hfd-service.initd"
